package com.ynkbny.service;

import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ynkbny.domain.Device;
import com.ynkbny.domain.DeviceHistoryData;
import com.ynkbny.domain.excel.MeterReadingExportVO;
import com.ynkbny.domain.pojo.DeviceExcelDataVO;
import com.ynkbny.domain.pojo.RegionTreeVO;
import com.ynkbny.domain.pojo.TreeProjDeviceVO;

import java.util.List;


/**
 * 设备表-表服务接口
 *
 * @author : juzipi123
 * @date : 2023-7-25
 */
public interface DeviceService extends IService<Device> {

    /**
     * 构建设备树结构
     *
     * @Author YY
     * @param projId 项目id
     * @return JSONObject对象
     */
    JSONObject buildDeviceTree(long projId);
    List<RegionTreeVO> buildRegionDeviceTree(long projId);

    DeviceExcelDataVO getDeviceByTime(String name,String deviceId,String startTime,String endTIme,String metric);
    MeterReadingExportVO getDeviceReadingByTime(String name, String deviceId, String startTime, String endTIme, String metric);
    /**
     * @author : juzipi123
     * @param projId 项目id
     */
    void delByProjId(Long projId);

    /**
     * @author : juzipi123
     */
    void del();

    /**
     * @author : juzipi123
     * @param projId 项目id
     * @return 结果
     */
    List<String> selectByprojId(Long projId);

    /**
     * @author : juzipi123
     * @param projId 项目id
     * @return 结果
     */
    TreeProjDeviceVO treeProjDevice(String projId);

    /**
     * 根据设备id查询
     *
     * @author : juzipi123
     * @param deviceId 设备id
     * @return 结果
     */
    Device selectByDeviceId(String deviceId);
    List<Device> getDeviceListByRegionId(String regionId);

    void delByDeviceId(String deviceId);
}